package com.qidian.mes.quality.controller;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.pojo.Quality;
import com.qidian.mes.quality.service.DefectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author gfdycxy
 * @Company cxy
 * @Description
 * @Time 2024/10/16 19:47
 */
@RestController
@CrossOrigin
@RequestMapping("/defect")
public class DefectController {
    @Autowired
    private DefectService defectService;

    @GetMapping("/list")
    public MESResult list() {
        return defectService.selectAll();
    }

    @PostMapping("/insert")
    public MESResult insert(@RequestBody Quality defect) {
        return defectService.insert(defect);
    }

    @DeleteMapping("/deleteById")
    public MESResult deleteById(String defectId) {
        return defectService.deleteById(defectId);
    }

    @DeleteMapping("/deleteByIds")
    public MESResult deleteByIds(String[] defectId) {
        return defectService.deleteByIds(defectId);
    }


}